//
//  MTLuckyModel.swift
//  MT
//
//  Created by ooops on 2020/1/21.
//  Copyright © 2020 张强. All rights reserved.
//

import Foundation
import ObjectMapper
import MTCategory

class MTLuckyModel: Mappable {
    
    /// 请求是否成功的code
    var code: Int?
    /// 请求返回的Message
    var message: String?
    /// 分页对象
    var page: PageModel?
    /// 时间戳
    var timestamp: TimeInterval?
    
    var result: [MTLuckyMoneyModel]?
    
    /// result 1 - 中奖的时候使用
    var result_1: MTLuckyMoneyModel?
    
    var rules: String?
    
    /// 总奖池
    var ticketAmount: Int?
    
    required public init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        code    <- map["code"]
        message <- map["message"]
        page <- map["page"]
        timestamp <- map["timestamp"]
        result  <- map["result"]
        result_1  <- map["result"]
        rules  <- map["rules"]
        ticketAmount  <- map["ticketAmount"]
    }
}

class MTLuckyMoneyModel: Mappable {
    
    /// 奖项id
    var id: Int?
    /// 奖项等级
    var level: Int?
    /// 奖项金额
    var ticketAmount: Int?
    /// 总奖池 - 中奖后用来刷新界面总奖池
    var totalAmount: Int?
    
    required public init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        id    <- map["id"]
        level <- map["level"]
        ticketAmount <- map["ticketAmount"]
        totalAmount <- map["totalAmount"]
    }
}


class MTLuckyReportModel: Mappable {
    
    /// 请求是否成功的code
    var code: Int?
    /// 请求返回的Message
    var message: String?
    /// 分页对象
    var page: PageModel?
    /// 时间戳
    var timestamp: TimeInterval?
    
    var result: [MTLuckyReportSubModel]?
    
    required public init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        code    <- map["code"]
        message <- map["message"]
        page <- map["page"]
        timestamp <- map["timestamp"]
        result  <- map["result"]
    }
}

class MTLuckyReportSubModel: Mappable {
    
    var createTime: String?
    /// 总奖池
    var ticketAmount: Int?
    
    required public init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        createTime  <- map["createTime"]
        ticketAmount  <- map["ticketAmount"]
    }
}
